<template>
	<!-- 消息中心 -->
	<CustomNavbar>
		<view class="navbar-content">
			<!-- 左侧返回按钮 -->
			<view class="nav-left" @click="goBack">
				<text class="back-icon">‹</text>
			</view>
			<!-- 中间标题 -->
			<view class="nav-title">消息</view>
		</view>
	</CustomNavbar>

	<!-- 消息列表 -->
	<view class="message-container">
		<view class="message-list">
			<view class="message-item" v-for="(item, index) in messageList" :key="index">
				<view class="message-left">
					<view class="message-header">
						<view class="message-title">{{ item.title }}</view>
						<view class="message-time">{{ item.time }}</view>
					</view>
					<view class="message-detail">{{ item.detail }}</view>
				</view>
			</view>
		</view>


	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'
	import CustomNavbar from '@/components/CustomNavbar.vue'
	import {
		onLoad
	} from '@dcloudio/uni-app'

	// 返回按钮
	const goBack = () => {
		uni.navigateBack()
	}

	// 消息列表数据
	const messageList = ref([{
			title: '支付成功通知',
			detail: '您已成功支付56.9元',
			time: '2023.3.11 11:09'
		},
		{
			title: '支付成功通知',
			detail: '您已成功支付56.9元',
			time: '2023.3.11 11:09'
		},
		{
			title: '支付成功通知',
			detail: '您已成功支付56.9元',
			time: '2023.3.11 11:09'
		},
		{
			title: '支付成功通知',
			detail: '您已成功支付56.9元',
			time: '2023.3.11 11:09'
		},
		{
			title: '支付成功通知',
			detail: '您已成功支付56.9元',
			time: '2023.3.11 11:09'
		},
		{
			title: '支付成功通知',
			detail: '您已成功支付56.9元',
			time: '2023.3.11 11:09'
		},
		{
			title: '支付成功通知',
			detail: '您已成功支付56.9元',
			time: '2023.3.11 11:09'
		},
		{
			title: '支付成功通知',
			detail: '您已成功支付56.9元',
			time: '2023.3.11 11:09'
		}
	])
</script>

<style scoped>
	/* 导航栏内容样式 */
	.navbar-content {
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 88rpx;
		/* position: relative; */
		margin: 0 -24rpx;
		padding: 0 24rpx;
	}

	.nav-left {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 60rpx;
		height: 88rpx;
	}

	.back-icon {
		color: #fff;
		font-size: 56rpx;
		font-weight: 300;
		line-height: 88rpx;
		transform: scaleY(1.3);
		cursor: pointer;
	}

	.nav-title {
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
		text-align: center;
		color: #fff;
		font-size: 36rpx;
		font-weight: bold;
		line-height: 88rpx;
	}







	/* 消息容器 */
	.message-container {
		/* background-color: #f5f5f5; */
		min-height: calc(100vh - 176rpx);
		/* padding: 20rpx; */
		position: absolute;
		top: 220rpx;
		width: 720rpx;
		padding-left: 25rpx;


	}

	.message-list {
		padding: 0;
	}

	/* 消息项样式 - 卡片样式 */
	.message-item {
		background-color: #fff;
		border-radius: 16rpx;
		padding: 30rpx;
		margin-bottom: 20rpx;
		box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
	}

	.message-left {
		width: 100%;
	}

	.message-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 12rpx;
	}

	.message-title {
		font-size: 32rpx;
		color: #333333;
		font-weight: 500;
		line-height: 44rpx;
	}

	.message-detail {
		font-size: 28rpx;
		color: #666666;
		line-height: 40rpx;
		margin-top: 8rpx;
	}

	.message-time {
		font-size: 24rpx;
		color: #999999;
		white-space: nowrap;
		line-height: 44rpx;
	}
</style>